package com.example.first_android.kotlin

import android.os.Bundle
import android.widget.ArrayAdapter
import android.widget.Spinner
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.first_android.R

class InputAreaActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_input_area)
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }
        val citySpinner=findViewById<Spinner>(R.id.city_spinner)
        val cityList= arrayListOf("北京","上海","广州","深圳","杭州","武汉","西安","长沙","南京","苏州","天津","重庆","青岛","济南","郑州","无锡","厦门","佛山","东莞","珠海","中山","石家庄","太原","西安","昆明","贵阳","海口","兰州","银川","西宁","乌鲁木齐","呼和浩特")
        val adapter= ArrayAdapter(this,android.R.layout.simple_spinner_item,cityList)
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
        citySpinner.adapter=adapter

    }
}